home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_01
/
1001014c
< prev
next >
Wrap
Text File
|
1991-11-16
|
346b
|
18 lines
Listing 4 -- the file freopen.c
/* freopen function */
#include <stdlib.h>
#include "xstdio.h"
FILE *(freopen)(const char *name, const char *mods, FILE *str)
{ /* reopen a file */
unsigned short mode = str->_Mode & _MALFIL;
str->_Mode &= ~_MALFIL;
fclose(str);
str->_Mode = mode;
return (_Foprep(name, mods, str));
}